<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">
<f:view id="view_main">
	<h:head>
		<title>TLS_WSC - LOGIN</title>
		<script type="text/javascript">
			function handleLoginRequest(xhr, status, args) {
				if (args.validationFailed || !args.loggedIn) {
					jQuery('#dialog').effect("shake", {
						times : 3
					}, 100);
				} else {
					dlg.hide();
					jQuery('#loginLink').fadeOut();
				}
			}
		</script>
		<script type="text/javascript"
			src="#{facesContext.externalContext.requestContextPath}/resources/images/js/highlight.js">
			
		</script>
	</h:head>

	<h:body onload="dlg.show();" style="font-size: 11px)">
		<p:growl id="growl" showDetail="false" life="5000" />
		<p:dialog closable="true" resizable="false" id="dialog" header="Login"
			widgetVar="dlg">
			<h:form id="form_login">
				<h:panelGrid columns="2" cellpadding="5" >
					<h:outputLabel accesskey="t" for="username" value="User" />
					<p:inputText requiredMessage="Please input user" accesskey="u"
						value="#{secuser.username}" id="username" required="true"
						label="User" />

					<h:outputLabel accesskey="p" for="password" value="Password" />
					<p:password requiredMessage="Please input password"
						value="#{secuser.password}" id="password" required="true"
						label="Please input password" />

					<f:facet name="footer">
						<p:outputPanel layout="block" style="text-align:center">
							<p:commandButton process="@form" accesskey="o" id="loginButton"
								value="OK" update=":growl form_login"
								action="#{secuser.validateUser()}" />
						</p:outputPanel>
					</f:facet>
				</h:panelGrid>
			</h:form>
		</p:dialog>

		<p:ajaxStatus style="width:5px;height:5px;" id="ajaxStatusPanel">
			<f:facet name="start">
				<h:graphicImage style="width:25px;height:25px;"
					value="../resources/images/ajax-loader.gif" />
			</f:facet>
			<f:facet name="complete">
				<h:graphicImage style="width:25px;height:25px;"
					value="../resources/images/ajax-done.png" />
			</f:facet>
		</p:ajaxStatus>

	</h:body>
</f:view>
</html>
